﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="SistemaTransacional.aspx.cs" Inherits="SATD_PREVIDENCIA_SA.WebForm1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="menuSuperior" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="menuLateral" runat="server">
    <div id="left-column">
        <h3>
            Definir Nome
        </h3>
        <ul class="nav">
            <li><a href="#">Incluir Novo Usuário</a></li>
            <li><a href="#">Alterar Usuário </a></li>
            <li><a href="#">Apagar Usuário </a></li>
        </ul>
    </div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="conteudo" runat="server">
    <div id="center-column">
        <div class="top-bar">
            <h1>
                Permissionamento - Área Exclusiva</h1>
        </div>
        <div class="select-bar">
            &nbsp;
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <strong>TIPO DE ACESSO:
                        <asp:DropDownList ID="cbTipoUsuario" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cbTipoUsuario_SelectedIndexChanged">
                            <asp:ListItem Selected="True" Value="0">-</asp:ListItem>
                            <asp:ListItem Value="01">Outros</asp:ListItem>
                            <asp:ListItem Value="88">Assistente administrativo</asp:ListItem>
                            <asp:ListItem Value="99">Usuário Master</asp:ListItem>
                        </asp:DropDownList>
                    </strong>
                </div>
                <br />
                <asp:Panel ID="pnlEhCorretor" runat="server" Visible="false">
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="2">
                                Outros
                            </th>
                        </tr>
                        <tr>
                            <td class="first" width="172">
                                <strong>Tipo do Produtor</strong>
                            </td>
                            <td class="last">
                                <asp:TextBox ID="txtTPPD" class="number" runat="server"></asp:TextBox>
                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtTPPD"
                                    ErrorMessage="Campo obrigatório" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                    ControlToValidate="txtTPPD" ErrorMessage="Valor Inválido" MaximumValue="99" 
                                    MinimumValue="1" SetFocusOnError="True"></asp:RangeValidator>
                        </tr>
                        <tr class="bg">
                            <td class="first">
                                <strong>Cód. do Produtor</strong>
                            </td>
                            <td class="last">
                                <asp:TextBox ID="txtCDPD" class="number" runat="server"></asp:TextBox>                               
                                                               
                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtCDPD"
                                    ErrorMessage="Campo obrigatório" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator2" runat="server" 
                                    ControlToValidate="txtCDPD" ErrorMessage="Valor Inválido" MaximumValue="999999" 
                                    MinimumValue="1" SetFocusOnError="True"></asp:RangeValidator>
                            </td>
                        </tr>
                    </table>
                    <br />
                </asp:Panel>
                <div class="table">
                    <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
                    <table class="listing form" cellpadding="0" cellspacing="0">
                        <tr>
                            <th class="full" colspan="2">
                                Permissionamento
                            </th>
                        </tr>
                        <tr>
                            <td class="first" width="172">
                                <strong>Criar o Usuário em</strong>
                            </td>
                            <td class="last">
                                <asp:CheckBoxList ID="chkCriarUsuarioEm" runat="server" 
                                    RepeatDirection="Horizontal" AutoPostBack="True" 
                                    onselectedindexchanged="chkCriarUsuarioEm_SelectedIndexChanged">
                                    <asp:ListItem Selected="True">Homologacao</asp:ListItem>
                                    <asp:ListItem>Producao</asp:ListItem>
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                        <tr class="bg">
                            <td class="first">
                                <strong>Tipo de Pessoa</strong>
                            </td>
                            <td class="last">
                                <asp:RadioButtonList ID="rbTipoPessoa" runat="server" RepeatDirection="Horizontal"
                                    AutoPostBack="True" OnSelectedIndexChanged="rbTipoPessoa_SelectedIndexChanged">
                                    <asp:ListItem Selected="True" Value="F">Física</asp:ListItem>
                                    <asp:ListItem Value="J">Jurídica</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td class="first">
                                <strong>Estado / Unidade</strong>
                            </td>
                            <td class="last">
                                <asp:DropDownList ID="cbEstado" class="text" runat="server" AutoPostBack="True" 
                                    onselectedindexchanged="cbEstado_SelectedIndexChanged">
                                    <asp:ListItem Selected="True">-</asp:ListItem>
                                    <asp:ListItem Value="AC">Acre</asp:ListItem>
                                    <asp:ListItem>Alagoas</asp:ListItem>
                                    <asp:ListItem>Amazonas</asp:ListItem>
                                    <asp:ListItem>Amapá</asp:ListItem>
                                    <asp:ListItem Value="BA">Bahia</asp:ListItem>
                                    <asp:ListItem Value="CE">Ceará</asp:ListItem>
                                    <asp:ListItem Value="DF">Distrito Federal</asp:ListItem>
                                    <asp:ListItem Value="ES">Espirito Santo</asp:ListItem>
                                    <asp:ListItem Value="GO">Goiás</asp:ListItem>
                                    <asp:ListItem Value="MA">Maranhão</asp:ListItem>
                                    <asp:ListItem Value="MG">Minas Gerais</asp:ListItem>
                                    <asp:ListItem Value="MS">Mato Grosso do Sul</asp:ListItem>
                                    <asp:ListItem Value="MT">Mato Grosso</asp:ListItem>
                                    <asp:ListItem Value="PA">Pará</asp:ListItem>
                                    <asp:ListItem Value="PB">Paraíba</asp:ListItem>
                                    <asp:ListItem Value="PE">Pernambuco</asp:ListItem>
                                    <asp:ListItem Value="PI">Piauí</asp:ListItem>
                                    <asp:ListItem Value="PR">Paraná</asp:ListItem>
                                    <asp:ListItem Value="RJ">Rio de Janeiro</asp:ListItem>
                                    <asp:ListItem Value="RN">Rio Grande do Norte</asp:ListItem>
                                    <asp:ListItem Value="RO">Rondônia</asp:ListItem>
                                    <asp:ListItem Value="RR">Roraima</asp:ListItem>
                                    <asp:ListItem Value="RS">Rio Grande do Sul</asp:ListItem>
                                    <asp:ListItem Value="SC">Santa Catarina</asp:ListItem>
                                    <asp:ListItem Value="SE">Sergipe</asp:ListItem>
                                    <asp:ListItem Value="SP">São Paulo</asp:ListItem>
                                    <asp:ListItem Value="TO">Tocantins</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;
                                <asp:DropDownList ID="cbUnidade" runat="server" AutoPostBack="True" class="text"
                                    OnSelectedIndexChanged="cbUnidade_SelectedIndexChanged" Visible="false">
                                </asp:DropDownList>
                                <asp:Label ID="lblEstadoSemUnidades" runat="server" ForeColor="Red" Text="Esse estado ainda não possui Unidades"
                                    Visible="False"></asp:Label>
                            </td>
                        </tr>
                        <asp:Panel ID="EhPessoaFisica" Visible="true" runat="server">
                            <tr class="bg">
                                <td class="first">
                                    <strong>CPF (000.000.000-00)</strong>
                                </td>
                                <td class="last">
                                    <asp:TextBox class="text" ID="txtCPF" runat="server"></asp:TextBox>
                                    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="txtCPF"
                                        ClearMaskOnLostFocus="false" Mask="999.999.999-99" MessageValidatorTip="true"
                                        MaskType="Number" InputDirection="LeftToRight">
                                    </cc1:MaskedEditExtender>
                                    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Campo obrigatório"
                                        ControlToValidate="txtCPF" Display="Dynamic"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCPF"
                                        ErrorMessage="Formato Inválido!" ValidationExpression="(\d{10,14})|(\d{2,3}.\d{3}.\d{3}/\d{4}-\d{2})|(^(\d{3}\.\d{3}\.\d{3}-\d{2})|(\d{11})$.)"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                        </asp:Panel>
                        <asp:Panel ID="EhPessoaJuridica" Visible="false" runat="server">
                            <tr class="bg">
                                <td class="first">
                                    <strong>CNPJ (00.000.000/0000-00)</strong>
                                </td>
                                <td class="last">
                                    <asp:TextBox class="text" ID="txtCNPJ" runat="server"></asp:TextBox>
                                    <cc1:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtCNPJ"
                                        ClearMaskOnLostFocus="false" Mask="99.999.999/9999-99" MessageValidatorTip="true"
                                        MaskType="Number" InputDirection="LeftToRight">
                                    </cc1:MaskedEditExtender>
                                    &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Campo obrigatório"
                                        ControlToValidate="txtCNPJ" Display="Dynamic"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtCNPJ"
                                        ErrorMessage="Formato Inválido!" ValidationExpression="(\d{10,14})|(\d{2,3}.\d{3}.\d{3}/\d{4}-\d{2})|(^(\d{3}\.\d{3}\.\d{3}-\d{2})|(\d{11})$.)"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                        </asp:Panel>
                        <tr class="first">
                            <td class="first">
                                <strong>Nome</strong>
                            </td>
                            <td class="last">
                                <asp:TextBox class="text" ID="txtNome" runat="server"></asp:TextBox>
                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Campo obrigatório"
                                    ControlToValidate="txtNome" SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr class="bg">
                            <td class="first">
                                <strong>Email</strong>
                            </td>
                            <td class="last">
                                <asp:TextBox class="text" ID="txtEmail" runat="server"></asp:TextBox>
                                &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Campo obrigatório"
                                    ControlToValidate="txtEmail" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEmail"
                                    ErrorMessage="Email inválido!" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                    Display="Dynamic" SetFocusOnError="True"></asp:RegularExpressionValidator>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table>
                        <tr>
                            <td>
                                <%--<asp:Button ID="btnGravar" Enabled="true" runat="server" Text="Confirmar" OnClick="btnGravar_Click" />--%>
                                <asp:Button ID="btnGravar" Enabled="False" runat="server" Text="Confirmar" OnClick="btnGravar_Click" />
                                <cc1:ConfirmButtonExtender ID="btnGravar_ConfirmButtonExtender" runat="server" ConfirmText="Confirma gravação?"
                                    Enabled="True" TargetControlID="btnGravar">
                                </cc1:ConfirmButtonExtender>
                            </td>
                            <td>
                                <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" OnClick="btnCancelar_Click" />
                            </td>
                        </tr>
                    </table>
                    <asp:Literal ID="lMensagem" runat="server"></asp:Literal>
                    &nbsp;</div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <a href="javascript:ExibeGravadoComSucesso()">&nbsp;</a>
    </div>
</asp:Content>